package com.taotao.controller;

import com.taotao.common.utils.JsonUtils;
import com.taotao.service.IPictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @Package com.taotao.controller
 * @Description:
 * @Author elwyn
 * @Date 2017/9/3 2:20
 * @Email elonyong@163.com
 */
@Controller
public class PictureController {
    @Autowired
    private IPictureService pictureService;

    @RequestMapping("/pic/upload")
    @ResponseBody
    public String pictureUpload(MultipartFile uploadFile) {
        Map map = pictureService.uploadPicture(uploadFile);
        return JsonUtils.objectToJson(map);
    }
}
